Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGLRenderer: Deprecate useLegacyLights, change default to false. #26392

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jul 8, 2023

Related issue: #24975 and #25479

Description

This PR deprecates WebGLRenderer.useLegacyLights. It also changes the default value to false.

The motivation behind this change is to have a single lighting mode in the engine which allows for physically correct workflows. It will also make the switch to WebGPURenderer easier since this renderer does not support a legacy lighting mode.

Changing the default of useLegacyLights will affect all applications that still use the legacy workflow. For the upcoming months, users can set the property back to true to restore the previous behavior. Since the property is deprecated, a migration to the new mode is required at some point. I think it's best if we provide a forum topic that explains the changes and how the migration tasks look like. The URL to this topic will be placed into the deprecation warnings.

All light intensities are affected by this PR since the artist-friendly light intensity scaling factor is not used anymore. That means light intensities are decreased by factor Math.PI. The behavior of spot and point lights (how they decay) also noticeably changes which has to be explained in the new guide.

@Mugen87 Mugen87 added this to the r155 milestone Jul 8, 2023
@Mugen87 Mugen87 merged commit cce80b8 into mrdoob:dev Jul 11, 2023
17 checks passed
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jul 11, 2023

Forum topic: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733

cstegel added a commit to cstegel/three.js that referenced this pull request Jul 26, 2023
See:

1. mrdoob#26392
2. mrdoob#26267

The default behavior of light intensities was changed. Some examples had the
light intensity values changed from 1 to 3 to preserve the old behavior.

This is necessary after merging dev into this branch.

The screenshots still visually look the same but I am committing them as well
in case there were any subtle changes due to this change in lighting behavior.
0b5vr added a commit to pixiv/three-vrm that referenced this pull request Jan 10, 2024
Starting from r155, the light unit is set to physically based one by default.
We need to multiply the directional light intensity by PI because of this change.

See: mrdoob/three.js#26392
0b5vr added a commit to pixiv/three-vrm that referenced this pull request Jan 15, 2024
Starting from r155, the light unit is set to physically based one by default.
We need to multiply the directional light intensity by PI because of this change.

See: mrdoob/three.js#26392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant